<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>小球弹跳</title>
  <style>
    *{
      padding: 0;
      margin: 0;
    }
    main{
      width: 100vw;
      height: 100vh;
      display: flex;
      justify-content:center;
      align-items:center;
      background-color: white; 
      display: flex;
      flex-direction: column;
    }
    article{
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: radial-gradient(at right top, #f39c12, #d35400);
      animation-name: ball;
      animation-duration: 1s;
      animation-direction: alternate;
      animation-iteration-count: infinite;
    }

    div{
      width: 100px;
      height: 10px;
      border: 50%;
      background-color: gray; 
      border-radius: 50%;
      animation-name: shadow;
      animation-duration: 1s;
      animation-direction: alternate-reverse;
      animation-iteration-count:infinite;
    }

    @keyframes ball{
      /* 这里的height改变是模拟形变 */
      from{
        height: 30px;
      }
      to{
        transform: translateY(-300px);
        height: 50px;
      }
    }
    @keyframes shadow{
      from{
        background: #000;
        transform: scale(0.3);
        filter: blur(10px);
      }
      to{
        background: #aaa;
        filter: blur(5px);
      }
    }
  </style>
</head>
<body>
  <main>
    <article></article>
    <div></div>
  </main>
  
</body>
</html>